<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css">
    <script type="text/javascript" src="/static/layui/layui.js"></script>
</head>
<body style="padding:10px;">
<form class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label">OKR-O</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="okrO" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">KR1</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="kr1" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">KR2</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="kr2" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">KR3</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="kr3" value="">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">更多KR</label>
        <div class="layui-btn-group">
        <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
        <button type="button" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon"></i></button>
        </div>

    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-inline">
            <select name="cat">
                <option value=0 selected></option>
                {volist name="cat" id="cat_v"}
                <option value="{$cat_v['id']}">{$cat_v['name']}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">负责人</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="people" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">重要性</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="iidx" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">进度%</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="pro" value="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">添加时间</label>
        <div class="layui-input-inline">
                <input type="date" class="layui-input" name="startime" value="">
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">截止时间</label>
        <div class="layui-input-inline">
                <input type="date" class="layui-input" name="ddl" value="">
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">上级目标</label>
        <div class="layui-input-inline">
                <input type="text" class="layui-input" name="superior" value="">
            </select>
        </div>
    </div>




</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button class="layui-btn" onclick="save()">发 布</button>
    </div>
</div>
<script type="text/javascript">
    layui.use(['layer','form'],function(){
        form = layui.form;
        layer = layui.layer;
        $ = layui.jquery;
    });
    function save(){
        $.post('/index.php/Index/add',$('form').serialize(),function(res){
            if(res.code>0){
                layer.alert(res.msg,{icon:2});
            }else{
                layer.msg(res.msg);
                setTimeout(function(){parent.window.location.reload();},1000);
            }
        },'json');
    }
</script>
</body>
</html>
